package org.snare.alumni.modules.app;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.snare.alumni.modules.admin.org.entity.OrgEntity;
import org.snare.alumni.modules.admin.org.service.api.OrgService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api(tags = "校友组织")
@RequestMapping("/alumni/app/org")
@RestController
@RequiredArgsConstructor
public class OrgController {

    private final OrgService orgService;

    @GetMapping("/list")
    @ApiOperation(value = "列表", httpMethod = "GET")
    public List<OrgEntity> list(@RequestParam(defaultValue = "0") String type) {
        return orgService.list(type);
    }

    @GetMapping("/detail")
    @ApiOperation(value = "详情", httpMethod = "GET")
    public OrgEntity detail(@RequestParam String id) {
        return orgService.detail(id);
    }

}
